package org.wu.reggie.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.wu.reggie.entity.SetmealDish;

import java.util.List;

public interface SetmealDishMapper {


    void saveBatch(@Param("setmealDishes") List<SetmealDish> setmealDishes);

    @Select("select * from setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> findById(@Param("setmealId") String setmealId);

    // 删除该套餐中的所有菜品
    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteByDishId(@Param("setmealId") String id);

    @Select("select * from setmeal_dish where setmeal_id=#{setmealId}")
    List<SetmealDish> findByDishId(@Param("setmealId")Long id);
}
